package com.app.library.utils

import android.content.Context
import android.content.Intent
import android.net.Uri
import android.text.TextUtils

object BrowserUtil {
    fun openBrowser(url: String?, context: Context?) {
        if (TextUtils.isEmpty(url) || context == null) {
            return
        }
        try {
            val intent = Intent()
            intent.action = Intent.ACTION_VIEW
            val websiteUri = Uri.parse(url)
            intent.data = websiteUri
            context.startActivity(intent)
        } catch (e: Exception) {
            e.printStackTrace()
        }
    }
}